<template>
   <div class="content">
    <div class="header">
      <div class="top">
        <div class="title">饿了么</div>
        <div class="icon">
        <span class="iconfont icon-qita"></span>
        <span class="iconfont icon-guanbi"></span>
        </div>
      </div>
      <span class="iconfont icon-fangdajing"></span>
      <input type="text" placeholder="输入商家，商品名称">
   </div>
   <div class="swiper">
      <img  :src="pic" alt="">
   </div>
   <div class="nav">
    <div class="title">猜你喜欢</div>
    <div class="choice">
        <span >综合排序</span>
        <span >距离最近</span>
        <span >销量最高</span>
        <span >筛选</span>
    </div>
    <div class="item">
        <span>年货节热卖</span>
        <span>年货节热卖</span>
        <span>年货节热卖</span>
        <span>年货节热卖</span>
    </div>
   </div>
   <div class="main">
      <div class="one" @click="toDetail(item.mtWmPoiId)" v-for="(item,index) in list" :key="index">
       <img :src="item.picUrl" alt="">
       <div class="con">
       <div class="title">{{item.name}}</div>
       <span>{{item.monthSalesTip}}</span>
       <div class="desc">
        <span>{{item.min_price}}</span>
        <span>{{item.month_saled_content}}</span>
       </div>
       <div class="way">
        <div class="yi">
            <span>{{item.minPriceTip}}</span>
            <span>{{item.shippingFeeTip}}</span>
            <span>$4.5</span>
        </div>
        <div class="two">
            <span>{{item.deliveryTimeTip}}{{item.distance}}</span>
        </div>
       </div>
       <div class="price">
        <span>40减5</span>
        <span>40减5</span>
        <span>40减5</span>
        <span>40减5</span>
       </div>
    </div>
    </div>
   </div>
  
</div>
</template>
<script>
import pic from '../../assets/assets/pic.png'
import {bao, shoplist} from '../../api/index.js'

export default {
    data(){
        return {     
          pic,
                
            list:[
                // {
                //   pic:pic ,id:'金百万烤鸭（苏家坨店）' 
                // }
            ]
        }
    },
    mounted(){
      
        shoplist({status:0}).then((res)=>{
        console.log(res.data.list)
        this.list=res.data.list
    })
      },
      methods:{
        toDetail(id){
            this.$router.push('/detail'+id)
        }
      }
      
}
</script>

<style scoped>
.content{
    height: 100%;
    width: 100%;
}
.header{
    position: relative;
    text-align: center;
    width: 100%;
    height: 100px;
    background-color: dodgerblue;
    box-sizing: border-box;
}
.header .top{
    padding: 15px;
    display: flex;
    justify-content: space-between;
}
.header .top .title{
    font-size: 18px;
    font-weight: 700;
    color: white;
}
.header .top .icon{
    box-sizing: border-box;
    width: 80px;
    border-radius: 15px;
    text-align: center;
    line-height: 30px;
    font-size: 20px;
    font-weight: 700;
    color: white;
    height: 30px;
    background-color: rgba(47, 79, 79, 0.21);
}
.header .top .icon .icon-qita{
    margin-right:10px ;
    border-right: 1px solid rgba(255, 255, 255, 0.568);
}
.header input{
    text-align: center;
    height: 30px;
    width: 90%;
    border-radius: 20px;
    border: none;
}
.header .icon-fangdajing{
    position: absolute;
    font-size: 20px;
    left: 100px;
    top: 65px;
}
.swiper {
    width: 95%;
    height: 90px;
    padding: 10px; 
}
.swiper img{
    width: 100%;
    height: 90px;
}
.nav .title{
    padding-left: 15px;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 700;
}
.nav .choice{
    margin-bottom:10px ;
    display: flex;
    justify-content: space-around;
}
.nav .item{
    display: flex;
    justify-content: space-around;
}
.nav .item span{
    text-align: center;
    line-height: 30px;
    font-size: 14px;
    border-radius: 5px;
    margin-right: 10px;
    height: 30px;
    background-color: rgba(128, 128, 128, 0.148);
    margin-bottom: 15px;
}
.main{
    height: 300px;
    flex: 1;
    overflow: auto;
}
.main .one{
    margin-bottom: 10px;
    display: flex;
    padding: 10px;
    width: 100%;
    height: 100px;
    box-sizing: border-box;
}
.main .con{
    flex: 1;
    padding: 5px;
}
.main .one img{
    width: 90px;
    height: 90px;
}
.desc span:nth-child(1){
    margin-right: 10px;
}
.way{
    display: flex;
    justify-content: space-between;
}
.way .yi{
    font-size: 12px;
}
.way .two{
    font-size: 12px;
}
.way .yi span{
    margin-right: 5px;
}
.price span{
    font-size: 14px;
    margin-right: 10px;
    width: 100%;
    height: 100%;
    border: 1px solid orangered;
}
.footer{
    width: 100%;
    height: 50px;
    box-sizing: border-box;
    position: fixed;
    bottom: 0;
    background-color: white;
    border-top:1px solid grey ;
}
.footer div{
   display: flex;
   justify-content: space-around;
   padding-top: 10px;
}
</style>